from py.email_server_sub import EmailServerSub
from py.handler import msg_manager
from py.handler.msg_handler_button import MsgHandlerButton
from py.handler.msg_handler_cam import MsgHandlerCam
from py.handler.msg_handler_cmd import MsgHandlerCmd
from py.handler.msg_handler_download import MsgHandlerDownload
from py.handler.msg_handler_lanuch import MsgHandlerLanuch
from py.handler.msg_handler_sceen import MsgHandlerScreen
from py.storage import AppObj


def server_start():
    msg_manager.add_handler("#cmd", MsgHandlerCmd())
    msg_manager.add_handler("#button", MsgHandlerButton())
    msg_manager.add_handler("#cam", MsgHandlerCam())
    msg_manager.add_handler("#download", MsgHandlerDownload())
    msg_manager.add_handler("#screen", MsgHandlerScreen())
    msg_manager.add_handler("#lanuch", MsgHandlerLanuch())

    AppObj.service = True
    email_server_sub = EmailServerSub()
    email_server_sub.start()
